<template>
  <div>
    <app-header></app-header>
    <div id="notice-details">
      <div class="onebet-breadcrumb">
        <span @click="handleBack">首页<i class="iconfont">&#xe630;</i></span>
        <span>公告详情</span>
      </div>
      <div class="details-title">平台公告</div>
      <div class="details-box">
        <div v-if="detailsData" v-html="detailsData"></div>
        <div v-if="!detailsData">暂无数据</div>
        <!--<div v-for="(list,index) in detailsData" :key="index">-->
        <!--<label for="">{{index}}:</label>-->
        <!--<span>{{list}}</span>-->
        <!--</div>-->
      </div>
    </div>
  </div>
</template>

<script>
  import header from '@/components/header/header'
  import Api from '@/axios/api/api'

  export default {
    name: 'notice-details',
    data() {
      return {
        detailsData: ''
      }
    },
    components: {
      'app-header': header
    },
    methods: {
      getNoticedetails() {
        let param = {
          id: this.$route.query.id
        }
        Api.getNoticedetails(param).then(res => {
          let result = res.data
          if (result.code === 0) {
            this.detailsData = result.data.content
          } else {
            this.$message.error(result.message)
          }
        })
      },
      handleBack() {
        this.$router.push({
          path: '/'
        })
      }
    },
    mounted() {
      this.getNoticedetails()
    }
  }
</script>

<style lang="less" scoped>
  #notice-details {
    width: 1200px;
    height: auto;
    display: block;
    margin: 0 auto;
    padding-bottom: 78px;
    padding-top: 10px;
    .details-title {
      width: 100%;
      height: 56px;
      line-height: 56px;
      display: block;
      overflow: hidden;
      text-align: left;
      background: #7B52F8;
      font-size: 18px;
      color: #FFFFFF;
      text-indent: 24px;
      margin-top: 10px;
    }
    .details-box {
      width: 100%;
      height: auto;
      display: block;
      padding: 0 20px;
      padding-bottom: 10px;
      box-sizing: border-box;
      box-shadow: 2px 2px 10px 0 rgba(219, 217, 223, 0.50);
      > div {
        width: 100%;
        height: auto;
        line-height: 36px;
        font-family: PingFangSC-Medium;
        font-size: 16px;
        color: #000000;
        display: block;
        overflow: hidden;
        margin-top: 6px;
      }
    }
  }
</style>
